<?php
/**
 *多页导出
 */
namespace App\Http\Controllers\Excel;



use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;


class MultipleSheetsExport implements WithMultipleSheets
{
    use Exportable;
    protected $request;

    /**
     * 
     */
    public function __construct(array $request)
    {
        $this->request = $request;
    }

    /**
     * @return array
     */
    public function sheets(): array
    {
        $sheets = [];
        $type = [
            1,2,3,4,5,6,7,8,9,10,11,12
        ];
        $trainee_id = $this->request['trainee_id'];
        $term_id = $this->request['term_id'];
        $user_id = $this->request['user_id'];
        foreach($type as $k=>$v){
            $sheets[] = new TraineeResultSheet($v,$trainee_id,$term_id,$this->request );
        }

        return $sheets;
    }






    
    
}

?>
